﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Articles.master" AutoEventWireup="false" CodeFile="ArticleListing.aspx.vb" Inherits="ArticleListing" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="DSArticles">
        <Columns>
            <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="ArticleSummary.aspx?ID={0}" 
                HeaderText="View Summary" Text="More" />
        </Columns>
    </asp:GridView>

    <asp:SqlDataSource ID="DSArticles" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
        ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
        SelectCommand="SELECT [Title], [Category], [ID] FROM [tblArticles] WHERE ([Category] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="Category" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

</asp:Content>

